package liurong.driver.jdk8;

/**
 * 
 * @author liurong
 *
 * @date 2018年8月8日
 */
public class Person implements Comparable<Person> {
	private String firstName;

	private String lastName;

	private String name;

	private Integer age;

	public Person() {
	}

	public Person(String firstName, String lastName, Integer age) {
		super();
		this.firstName = firstName;
		this.lastName = lastName;
		this.age = age;
	}

	public Person(String name, Integer age) {
		this.name = name;
		this.age = age;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Override
	public int compareTo(Person o) {
		if (o.getAge() > age) {
			return 1;
		} else if (o.getAge() < age) {
			return -1;
		}
		return 0;
	}

	@Override
	public String toString() {
		return "Person [firstName=" + firstName + ", lastName=" + lastName + ", name=" + name + ", age=" + age + "]";
	}

}
